package com.example.ioc;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author ：wuhong-016
 * @version v1.0.0
 * @Create : 2021/1/25 18:04
 * @Description : TODO
 **/
public class A {

    private static Pattern pointCutClassPattern;

    public static void main(String[] args) {

//        Pattern p = Pattern.compile("\\d+");
//        Matcher m = p.matcher("22bb23");
//        //返回true,因为\d+匹配到了前面的22
//        System.out.println(m.lookingAt());
//        Matcher m2 = p.matcher("aa2223");
//        //返回false,因为\d+不能匹配前面的aa
//        System.out.println(m2.lookingAt());
        String pattern = ".* com.example.ioc.service.impl.*ServiceImpl.*";
        pointCutClassPattern = Pattern.compile(pattern);
        String methodString = "public void com.example.ioc.service.impl.TransferServiceImpl.transfer(java.lang.String,java.lang.String,int)";
        System.out.println(pointCutClassPattern.matcher(methodString).matches());

        methodString = "public com.example.ioc.service.impl.TransferServiceImpl.transfer(java.lang.String,java.lang.String,int)";
        System.out.println(pointCutClassPattern.matcher(methodString).matches());
    }

}
